The FAT (File Allocation Table) file system is a file system for mobile phones and other embedded devices for Multi-media applications such as MP3, video images and recording. FAT is Microsoft Windows PC (personal computer) compatible. Such a file system, as well as any file system with similar properties under a given operating system, has an hierarchical tree-like structure such as with directories, subdirectories and files in them. A root directory is a directory that not a subdirectory of any directory, i.e. at a root of the tree. Opening Windows Explorer on a Windows PC pictorially shows the hierarchical tree-like structure, and there the directories and subdirectories are called folders.
However, if a device with FAT is used as removable storage media, the FAT file system is or may be susceptible to lose, or incorrectly update file system Meta data and User data due to uncontrolled power failures. In this context, the contents of a file are referred to as User data. The Directory entry structure data of a File/directory and associated FAT table entries are referred to as Meta data. In electronic embedded system environments the loss or corruption of data is undesirable.
A conventional FAT (File Allocation Table) file system thus apparently is not power-fail safe. If there is a power failure while modifying the files or directories, the integrity of the Meta data of the file system is not guaranteed, meaning the user might be unable to access any of the stored files. Logging file system transactions might be used, but prior FAT variants suffer from one or more of the following drawbacks: 1) Performance degradation, 2) Unsuitability for removable media, 3) Need for additional hardware, 4) Not all transactions are power fail safe, 5) No dynamic logging space allocation.
Some FAT-related approaches are noted next. KFAT: Log based transactional FAT file system for embedded mobile systems, in Proceedings of 2005 US-Korea Conference, ICTS-142, 2005. This file system apparently maintains the log of file system operations in a normal file created in root directory of the FAT file system.
U.S. Pat. No. 5,974,426 discloses a Device and method for data recovery in a file system. It apparently maintains recovery information in the non-volatile memory. If a crash occurs, then during reboot the file system is updated using this recovery information. This method apparently undesirably requires an additional SRAM coupled with Flash memory.
U.S. Pat. No. 7,174,420 discloses TFAT: Transaction Safe FAT File system. This File system apparently does not maintain any log information of the file system operation. Instead FAT2 is updated first with the requested file system operation. Upon successful completion of a transaction, the FAT2 file is copied to FAT1. If a power-failure occurs while updating FAT2, then apparently the contents of FAT2 are completely ignored and entire FAT1 is copied to FAT2. Presumably this means slow performance because the entire FAT table needs to be updated. In TFAT, write operations made to the root directory of FAT16 are apparently not transaction safe either.
U.S. Pat. No. 6,742,079 File system for avoiding loss of data, maintains extra sectors as reserved sectors to store the file system logs. This File system for avoiding data loss can declare the required sectors for logging operations as reserved sectors apparently only during file system format. If the FAT file system is formatted by a Windows PC with only one reserved sector, then this File system apparently cannot store file system logs due to unavailability of sectors.
Accordingly, some ways of providing much better file allocation table file systems would be very desirable in the art.